﻿Imports VB = Microsoft.VisualBasic
Public Class frmRegister

    Private Sub frmRegister_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtUser.KeyUp
        If e.KeyCode = Keys.Enter Then
            Me.Cursor = Cursors.WaitCursor
            txtInstallCode.Text = frmMain.MyActiveLock.InstallationCode(txtUser.Text)
            Me.Cursor = Cursors.Default
        End If
    End Sub


    Private Sub cmdRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRegister.Click
        If (Len(txtActivationCode.Text) > 15) Then
            Me.Cursor = Cursors.WaitCursor
            frmMain.MyActiveLock.Register(txtActivationCode.Text)
            Me.Cursor = Cursors.Default
            MessageBox.Show("Restart application..")
        Else
            MessageBox.Show("This is not a valid activation code")
        End If
    End Sub
End Class